<admintpl file="header"/>
</head>
<body>
<div class="wrap">
    <ul class="nav nav-tabs">
        <li><a href="{:U('banner/index')}">Banner列表</a></li>
        <li><a href="{:U('banner/add')}">添加Banner</a></li>
        <li class="active"><a>编辑Banner</a></li>
    </ul>
    <form method="post" class="form-horizontal js-ajax-form" action="{:U('banner/edit_post',array('p'=>$p))}">
        <fieldset>

            <div class="control-group">
                <label class="control-label">名称</label>
                <div class="controls">
                    <input type="text" name="name" value="{$name}"><span class="form-required">*</span>
                    <input type="hidden" name="id" value="{$id}">
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">banner位置</label>
                <div class="controls">
                    <select name="classify_id" ><span class="form-required">*</span>
                        <option name="classify_id" value="0" >首页banner</option>
                        <foreach name="classifies" item="vo">
                            <option name="classify_id" value="{$vo.id}" {$vo.selected}>{$vo.name}banner</option>
                        </foreach>
                    </select>
                </div>
            </div>
            <div class="control-group">
                <label class="control-label">Banner图</label>
                <input type="hidden" name="image" id="thumb" value="{$image}">
                <a href="javascript:upload_one_image('图片上传','#thumb');" style="padding-left:20px">
                    <if condition="empty($image)">
                        <img src="__TMPL__Public/assets/images/default-thumbnail.png" id="thumb-preview" width="135" style="cursor: hand"/>
                        <else />
                        <img src="{:sp_get_image_preview_url($image)}" id="thumb-preview" width="135" style="cursor: hand"/>
                    </if>
                </a>
                <input type="button" class="btn btn-small" onclick="$('#thumb-preview').attr('src','__TMPL__Public/assets/images/default-thumbnail.png');$('#thumb').val('');return false;" value="取消图片">

            </div>
            <div class="control-group">
                <label class="control-label">Banner链接</label>
                <div class="controls">
                    <input type="text" name="cook_id" value="{$cook_id}"><span class="form-required">*</span>
                </div>
            </div>

        </fieldset>
        <div class="form-actions">
            <button type="submit" class="btn btn-primary js-ajax-submit">{:L('ADD')}</button>
            <a class="btn" href="javascript:history.back(-1);">{:L('BACK')}</a>
        </div>
    </form>
</div>
<script src="__PUBLIC__/js/common.js"></script>

</body>
</html>